﻿ <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <style>
        .carousel {
            width:98%;
            position: relative;
            overflow: hidden;
            height: 200px;
            margin-bottom: 30px;
            background-color: white; 
        }
        .carousel img {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            display: none;
        }
        .carousel img.active {
            display: block;
        }
        .auto-style3 {
            margin-left: 0px;
        }
        .auto-style4 {
            width: 1423px;
        }
        .auto-style5 {
            width: 284px;
        }
        .auto-style6 {
            width: 285px;
        }
    </style>
    <div class="carousel">
                <img src="Image/money.jpg" class="active" alt="图片1" />
                <img src="Image/R-C.png"  alt="图片2" />
                <img src="Image/true.gif" alt="图片3" />
                <button class="prev" type="button" onclick="changeSlide(-1)">❮</button>
                <button class="next" type="button" onclick="changeSlide(1)">❯</button>
            </div>
    <script> 
       let currentSlide = 0;
       const slides = document.querySelectorAll('.carousel img');

       function showSlide(index) {
           slides.forEach((slide, i) => {
               slide.classList.remove('active');
               if (i === index) {
                   slide.classList.add('active');
               }
           });
       }

       function changeSlide(direction) {
           currentSlide = (currentSlide + direction + slides.length) % slides.length;
           showSlide(currentSlide);
        }

       window.onload = function () {
           showSlide(currentSlide);
           setInterval(() => changeSlide(1), 10000);
       };
    </script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <asp:GridView ID="gvProduct" runat="server" AllowPaging="True" AutoGenerateColumns="False" 
        OnPageIndexChanging="gvProduct_PageIndexChanging" PagerSettings-Mode="NextPrevious" PageSize="5" Width="95%" 
        OnSelectedIndexChanged="gvProduct_SelectedIndexChanged">
    <PagerSettings FirstPageText="首页" LastPageText="尾页" Mode="NextPrevious" NextPageText="下一页" Position="TopAndBottom" PreviousPageText="上一页" />
    <Columns>
      <asp:TemplateField>
        <ItemTemplate>
          <table style="border: 1px solid #808080; width: 100%;">
            <tr>
              <td rowspan="7" style="text-align: center; border: 1px; vertical-align: middle; width: 40%;">
                <asp:Image ID="imgProduct" runat="server" ImageUrl='<%# Bind("image") %>' Height="300px" Width="300px" />
              </td>
              <td style="border: 1px solid #808080; width: 40%;">商品编号： </td>
              <td style="border: 1px solid #808080; width: 20%;">
                <asp:Label ID="lblProductId" runat="server" Text='<%# Bind("id") %>'></asp:Label>
              </td>
            </tr>
            <tr>
              <td style="border: 1px solid #808080;">商品分类： </td>
              <td style="border: 1px solid #808080;">
                <asp:Label ID="lblCategoryId" runat="server" Text='<%# Bind("type") %>'></asp:Label>
              </td>
            </tr>
            <tr>
              <td style="border: 1px solid #808080;">商品名称： </td>
              <td style="border: 1px solid #808080;">
                <asp:Label ID="lblName" runat="server" Text='<%# Bind("name") %>'></asp:Label>
              </td>
            </tr>
            <tr>
              <td style="border: 1px solid #808080;">拍卖价： </td>
              <td style="border: 1px solid #808080;">
                <asp:Label ID="lblListPrice" runat="server" Text='<%# Bind("price") %>'></asp:Label>
              </td>
            </tr>
            <tr>
              <td style="border: 1px solid #808080;">加价幅度： </td>
              <td style="border: 1px solid #808080;">
                <asp:Label ID="lblUnitCost" runat="server" Text='<%# Bind("zengchang") %>'></asp:Label>
              </td>
            </tr>
            <tr>
              <td style="border: 1px solid #808080;">日期： </td>
              <td style="border: 1px solid #808080;">
                <asp:Label ID="lblDescn" runat="server" Text='<%# Bind("riqi") %>'></asp:Label>
              </td>
            </tr>
            <tr>
              <td style="border: 1px solid #808080;">拍卖时长： </td>
              <td style="border: 1px solid #808080;">
                <asp:Label ID="lblQty" runat="server" Text='<%# Bind("time") %>'></asp:Label>
              </td>
            </tr>
          </table>
        </ItemTemplate>
      </asp:TemplateField>
      <asp:HyperLinkField HeaderText="详细信息" Text="查看" DataNavigateUrlFields="ID" DataNavigateUrlFormatString="~/spck.aspx?ID={0}" DataTextFormatString="{0:c}" />
    </Columns>
  </asp:GridView>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="ContentPlaceHolder5" Runat="Server">
    
</asp:Content>
